<%@ Page Language="vb" AutoEventWireup="false" Codebehind="siteIndex.aspx.vb" Inherits="georgia_globaltp.siteIndex" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
	<HEAD>
		<title>FedGMR 2.0 Usage Statistics</title>
		<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
		<meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
		<meta content="JavaScript" name="vs_defaultClientScript">
		<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
		<style>.grad_2 { FILTER: progid:DXImageTransform.Microsoft.gradient(startColorstr=#C4CFE1, endColorstr=#ffffff, gradienttype=1); WIDTH: 100%; BACKGROUND-COLOR: #c4cfe1 }
		</style>
		<LINK href="/Admin/includes/adj_styles.css" type="text/css" rel="stylesheet">
		<script language="javascript">
     
     function sumColumn(x,strDisplay,usercount){
      var a1 = new Number(document.getElementById(x + "r1").innerHTML) ;
      var a2 = new Number(document.getElementById(x + "r2").innerHTML) ;
      var a3 = new Number(document.getElementById(x + "r3").innerHTML) ;
      var a4 = new Number(document.getElementById(x + "r4").innerHTML) ;
      var a5 = new Number(document.getElementById(x + "r5").innerHTML) ;
      var a6 = new Number(document.getElementById(x + "r6").innerHTML) ;
       var b1;
      var b2;
      var b3;
      var b4;
      var b5;
      var b6;
          if(usercount==0){
                var total = new Number( a1 + a2 + a3 + a4 + a5 + a6);
          }else{
                var total = new Number(usercount);
          }
          if(a1!=0){
                b1 = Math.round((a1/total) * 100);
          }else{
                b1=0;
          }
          if(a2!=0){
                b2 = Math.round((a2/total) * 100);   //GMBL Impact
          }else{
                b2=0;
          }
          if(a3!=0){
                b3 = Math.round((a3/total) * 100);   //Stocks
          }else{
                b3=0;
          }
          if(a4!=0){
                b4 = Math.round((a4/total) * 100);
          }else{
                b4=0;
          }
          if(a5!=0){
                b5 = Math.round((a5/total) * 100);
          }else{
                b5=0;
          }
          if(a6!=0){
                b6 = Math.round((a6/total) * 100);
          }else{
                b6=0;
          }
           
      document.write("<style>")
      document.write(".tblhead2{font-family : MS Sans Serif, Geneva, sans-serif;font-weight : bold;color : Yellow;Font-Size : 14px;background-color : Navy;}")
      document.write(".msg2{ font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 12px; color: Black;}")
      document.write(".msg3{ font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 12px; color: Blue;}")
      document.write("</style>")
      document.write("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"#DEDBF5\" align=\"center\" width=\"100%\">")
      document.write("<tr><td colspan=\"2\" class=\"tblhead2\" align=\"center\">" + strDisplay + "</td></tr>")
      document.write("<tr><td class=\"msg2\" valign=\"center\">Gross Margin By Location&nbsp;</td>")
      document.write("<td class=\"msg3\"><img src=\"images\/g_red.gif\" width=\"" + b1 + "\" height=\"11\" border=\"0\">&nbsp;" + b1 + "%</td></tr>")
      document.write("<tr><td class=\"msg2\" valign=\"center\">Gross Margin Impact&nbsp;</td>")
      document.write("<td class=\"msg3\"><img src=\"images\/g_blue.gif\" width=\"" + b2 + "\" height=\"11\" border=\"0\">&nbsp;" + b2 + "%</td></tr>")
      document.write("<tr><td class=\"msg2\" valign=\"center\">Stocks&nbsp;</td>")
      document.write("<td class=\"msg3\"><img src=\"images\/g_black.gif\" width=\"" + b3 + "\" height=\"11\" border=\"0\">&nbsp;" + b3 + "%</td></tr>")
      document.write("<tr><td class=\"msg2\" valign=\"center\">Comp Store Stock&nbsp;</td>")
      document.write("<td class=\"msg3\"><img src=\"images\/g_green.gif\" width=\"" + b4 + "\" height=\"11\" border=\"0\">&nbsp;" + b4 + "%</td></tr>")
      document.write("<tr><td class=\"msg2\" valign=\"center\">True Receipts&nbsp;</td>")
      document.write("<td class=\"msg3\"><img src=\"images\/g_brown.gif\" width=\"" + b5 + "\" height=\"11\" border=\"0\">&nbsp;" + b5 + "%</td></tr>")
      document.write("<tr><td class=\"msg2\" valign=\"center\">Markdown By Type&nbsp;</td>")
      document.write("<td class=\"msg3\"><img src=\"images\/g_gray.gif\" width=\"" + b6 + "\" height=\"11\" border=\"0\">&nbsp;" + b6 + "%</td></tr>")
      document.write("<tr><td colspan=\"2\"><hr></td></tr>")
      document.write("<tr><td colspan=\"2\" class=\"msg2\" align=\"right\"><b>Total:&nbsp;</b><span class=\"msg3\"><b>" + FormatNumberBy3(total,".",",") + "</b></td></tr>")
      document.write("</table>")
      document.write("<br>")
     
}
function StatSummary(){
//Displays
      var a1 = new Number(document.getElementById("c2r1").innerHTML) ;
      var a2 = new Number(document.getElementById("c2r2").innerHTML) ;
      var a3 = new Number(document.getElementById("c2r3").innerHTML) ;
      var a4 = new Number(document.getElementById("c2r4").innerHTML) ;
      var a5 = new Number(document.getElementById("c2r5").innerHTML) ;
      var a6 = new Number(document.getElementById("c2r6").innerHTML) ;
      var total_display = new Number( a1 + a2 + a3 + a4 + a5 + a6);
//Drill Down
      var b1 = new Number(document.getElementById("c3r1").innerHTML) ;
      var b2 = new Number(document.getElementById("c3r2").innerHTML) ;
      var b3 = new Number(document.getElementById("c3r3").innerHTML) ;
      var b4 = new Number(document.getElementById("c3r4").innerHTML) ;
      var b5 = new Number(document.getElementById("c3r5").innerHTML) ;
      var b6 = new Number(document.getElementById("c3r6").innerHTML) ;
      var total_drill = new Number( b1 + b2 + b3 + b4 + b5 + b6);      
//Sort
      var c1 = new Number(document.getElementById("c4r1").innerHTML) ;
      var c2 = new Number(document.getElementById("c4r2").innerHTML) ;
      var c3 = new Number(document.getElementById("c4r3").innerHTML) ;
      var c4 = new Number(document.getElementById("c4r4").innerHTML) ;
      var c5 = new Number(document.getElementById("c4r5").innerHTML) ;
      var c6 = new Number(document.getElementById("c4r6").innerHTML) ;
      var total_sort = new Number( c1 + c2 + c3 + c4 + c5 + c6); 
//Export
      var d1 = new Number(document.getElementById("c5r1").innerHTML) ;
      var d2 = new Number(document.getElementById("c5r2").innerHTML) ;
      var d3 = new Number(document.getElementById("c5r3").innerHTML) ;
      var d4 = new Number(document.getElementById("c5r4").innerHTML) ;
      var d5 = new Number(document.getElementById("c5r5").innerHTML) ;
      var d6 = new Number(document.getElementById("c5r6").innerHTML) ;
      var total_export = new Number( d1 + d2 + d3 + d4 + d5 + d6); 
//Print
      var e1 = new Number(document.getElementById("c6r1").innerHTML) ;
      var e2 = new Number(document.getElementById("c6r2").innerHTML) ;
      var e3 = new Number(document.getElementById("c6r3").innerHTML) ;
      var e4 = new Number(document.getElementById("c6r4").innerHTML) ;
      var e5 = new Number(document.getElementById("c6r5").innerHTML) ;
      var e6 = new Number(document.getElementById("c6r6").innerHTML) ;
      var total_print = new Number( e1 + e2 + e3 + e4 + e5 + e6);
//Totals
      var GrandTotal = new Number(total_display + total_drill + total_sort + total_export + total_print);     
               
       var b1;
      var b2;
      var b3;
      var b4;
      var b5;

      if(total_display!=0){
         b1 = Math.round((total_display/GrandTotal) * 100);
      }else{
         b1=0;
      }
      if(total_drill!=0){
         b2 = Math.round((total_drill/GrandTotal) * 100);
      }else{
         b2=0;
      }
      if(total_sort!=0){
         b3 = Math.round((total_sort/GrandTotal) * 100);
      }else{
         b3=0;
      }
      if(total_export!=0){
         b4 = Math.round((total_export/GrandTotal) * 100);
      }else{
         b4=0;
      }
      if(total_print!=0){
         b5 = Math.round((total_print/GrandTotal) * 100);
      }else{
         b5=0;
      }
     
           
      document.write("<style>")
      document.write(".tblhead2{font-family : MS Sans Serif, Geneva, sans-serif;font-weight : bold;color : Yellow;Font-Size : 14px;background-color : Navy;}")
      document.write(".msg2{ font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 12px; color: Black;}")
      document.write(".msg3{ font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 12px; color: Blue;}")
      document.write("</style>")
      document.write("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"#DEDBF5\" align=\"center\" width=\"100%\">")
      document.write("<tr><td colspan=\"2\" class=\"tblhead2\" align=\"center\">Summary Of All Events</td></tr>")
      document.write("<tr><td class=\"msg2\" valign=\"center\">Displays&nbsp;</td>")
      document.write("<td class=\"msg3\"><img src=\"images\/g_red.gif\" width=\"" + b1 + "\" height=\"11\" border=\"0\">&nbsp;" + b1 + "%</td></tr>")
      document.write("<tr><td class=\"msg2\" valign=\"center\">Drill Down&nbsp;</td>")
      document.write("<td class=\"msg3\"><img src=\"images\/g_blue.gif\" width=\"" + b2 + "\" height=\"11\" border=\"0\">&nbsp;" + b2 + "%</td></tr>")
      document.write("<tr><td class=\"msg2\" valign=\"center\">Sort&nbsp;</td>")
      document.write("<td class=\"msg3\"><img src=\"images\/g_black.gif\" width=\"" + b3 + "\" height=\"11\" border=\"0\">&nbsp;" + b3 + "%</td></tr>")
      document.write("<tr><td class=\"msg2\" valign=\"center\">Export&nbsp;</td>")
      document.write("<td class=\"msg3\"><img src=\"images\/g_green.gif\" width=\"" + b4 + "\" height=\"11\" border=\"0\">&nbsp;" + b4 + "%</td></tr>")
      document.write("<tr><td class=\"msg2\" valign=\"center\">Print&nbsp;</td>")
      document.write("<td class=\"msg3\"><img src=\"images\/g_brown.gif\" width=\"" + b5 + "\" height=\"11\" border=\"0\">&nbsp;" + b5 + "%</td></tr>")
      //document.write("<tr><td class=\"msg2\" valign=\"center\">Markdown By Type&nbsp;</td>")
      //document.write("<td class=\"msg3\"><img src=\"images\/g_gray.gif\" width=\"" + b6 + "\" height=\"11\" border=\"0\">&nbsp;" + b6 + "%</td></tr>")
      document.write("<tr><td colspan=\"2\"><hr></td></tr>")
      document.write("<tr><td colspan=\"2\" class=\"msg2\" align=\"right\"><b>Total:&nbsp;</b><span class=\"msg3\"><b>" + FormatNumberBy3(GrandTotal,".",",") + "</b></td></tr>")
      document.write("</table>")
      document.write("<br>")
     
}
function FormatNumberBy3(num, decpoint, sep) {
  // check for missing parameters and use defaults if so
  if (arguments.length == 2) {
    sep = ",";
  }
  if (arguments.length == 1) {
    sep = ",";
    decpoint = ".";
  }
  // need a string for operations
  num = num.toString();
  // separate the whole number and the fraction if possible
  a = num.split(decpoint);
  x = a[0]; // decimal
  y = a[1]; // fraction
  z = "";


  if (typeof(x) != "undefined") {
    // reverse the digits. regexp works from left to right.
    for (i=x.length-1;i>=0;i--)
      z += x.charAt(i);
    // add seperators. but undo the trailing one, if there
    z = z.replace(/(\d{3})/g, "$1" + sep);
    if (z.slice(-sep.length) == sep)
      z = z.slice(0, -sep.length);
    x = "";
    // reverse again to get back the number
    for (i=z.length-1;i>=0;i--)
      x += z.charAt(i);
    // add the fraction back in, if it was there
    if (typeof(y) != "undefined" && y.length > 0)
      x += decpoint + y;
  }
  return x;
}
		</script>
	</HEAD>
	<body MS_POSITIONING="GridLayout">
		<script>HideWait();</script>
		<div align="center"><font face="Arial" size="5"><b>GA Global Trade Portal Usage Statistics</b></font></div>
		<div align="center"><asp:Label ID="lblDate" Runat="server" CssClass="msg3"></asp:Label></div>
		<div align="center"><asp:Label ID="lblTimestamp" Runat="server" CssClass="msg2"></asp:Label></div>
		<br>
		<br>
		<table align="center" width="100%">
			<tr>
				<td align="right" class="msg2">[<a href="ExcelXport.aspx">New Query</a>]</td>
			</tr>
		</table>
		<table align="center" width="100%">
			<tr>
				<td>
					<asp:Table ID="Table1" Runat="server" cellspacing="0" style="BORDER-COLLAPSE:collapse" Width="100%"></asp:Table>
				</td>
			</tr>
			<tr>
				<td class="msg2a">* not included in any percentage calculation</td>
			</tr>
		</table>
		<br>
		<table align="center" border="0" width="100%">
			<tr>
				<td width="50%" class="msg2" align="center" valign="middle">Percent totals may not 
					add up to exactly 100% due to rounding.</td>
				<td width="50%"><script>StatSummary()</script></td>
			</tr>
			<tr>
				<td><script>sumColumn('c1', 'Unique Users','<%=intGMRUsers%>')</script></td>
				<td><script>sumColumn('c2', 'Displays','0')</script></td>
			</tr>
			<tr>
				<td><script>sumColumn('c3', 'Drill Down','0')</script></td>
				<td><script>sumColumn('c4', 'Sort','0')</script></td>
			</tr>
			<tr>
				<td><script>sumColumn('c5', 'Export','0')</script></td>
				<td><script>sumColumn('c6', 'Print','0')</script></td>
			</tr>
		</table>
		<table align="center" width="100%">
			<tr>
				<td align="right" class="msg2">[<a href="Statistics.aspx">New Query</a>]</td>
			</tr>
		</table>
	</body>
</HTML>
